#pragma once
#ifndef __G_INTERSECTOR_H__
#define __G_INTERSECTOR_H__

#include "GDisk.h"
#include "GRay2.h"
#include "GRay3.h"
#include "GPlane.h"
#include "GSphere.h"
#include "GCircle.h"
#include "GVector2.h"
#include "GVector3.h"
#include "GRectangleAligned.h"
#include "GRectangleOriented.h"
#include "GTriangle2.h"
#include "GTriangle3.h"
#include "GBoxOriented.h"
#include "GBoxAligned.h"

#include "GUtilities/GTypes.h"

namespace GMath
{

	class GIntersector
	{
	private:
						GIntersector();
						GIntersector(const GIntersector& Other);
						~GIntersector();
			
	public:
		static bool		Intersect(const GRay2& Ray, const GTriangle2& Triangle);
		static bool		Intersect(const GRay2& Ray, const GTriangle2& Triangle, float& T0);

		static bool		Intersect(const GRay2& Ray, const GRectangleAligned& Rectangle);
		static bool		Intersect(const GRay2& Ray, const GRectangleAligned& Rectangle, float& T0, float& T1);

		static bool		Intersect(const GRay2& Ray, const GRectangleOriented& Rectangle);
		static bool		Intersect(const GRay2& Ray, const GRectangleOriented& Rectangle, float& T0, float& T1);
		
		static bool		Intersect(const GRay2& Ray, const GCircle& Circle);
		static bool		Intersect(const GRay2& Ray, const GCircle& Circle, float& T0, float& T1);
		
		static bool		Intersect(const GRay3& Ray, const GDisk& Disk);
		static bool		Intersect(const GRay3& Ray, const GDisk& Disk, float& T0, float& T1);

		static bool		Intersect(const GRay3& Ray, const GPlane& Plane);
		static bool		Intersect(const GRay3& Ray, const GPlane& Plane, float& T0, float& T1);

		static bool		Intersect(const GRay3& Ray, const GSphere& Sphere);
		static bool		Intersect(const GRay3& Ray, const GSphere& Sphere, float& T0, float& T1);

		static bool		Intersect(const GRay3& Ray, const GTriangle3& Triangle);
		static bool		Intersect(const GRay3& Ray, const GTriangle3& Triangle, float& T0, float& T1);

		static bool		Intersect(const GRay3& Ray, const GBoxAligned& Box);
		static bool		Intersect(const GRay3& Ray, const GBoxAligned& Box, float& T0, float& T1);

		static bool		Intersect(const GRay3& Ray, const GBoxOriented& Box);
		static bool		Intersect(const GRay3& Ray, const GBoxOriented& Box, float& T0, float& T1);

	
		static bool		Intersect(const GRectangleAligned& Rectangle, const GCircle& Circle);
		static bool		Intersect(const GRectangleAligned& Rectangle, const GRectangleAligned& Rectangle2);
		static bool		Intersect(const GRectangleAligned& Rectangle, const GVector3& Point);

		static bool		Intersect(const GCircle& Circle, const GCircle& Circle2);
		static bool		Intersect(const GCircle& Circle, const GVector2& Point);

		static bool		Intersect(const GSphere& Sphere, const GBoxOriented& Box);
		static bool		Intersect(const GSphere& Sphere, const GBoxAligned& Box);
		static bool		Intersect(const GSphere& Sphere, const GSphere& Sphere2);
		static bool		Intersect(const GSphere& Sphere, const GVector3& Point);

		//! Write frustum intersections with boxaligned, boxoriented, sphere, cylinder etc.

		static bool		Intersect(const GBoxOriented& Box, const GBoxOriented& Box2);
		static bool		Intersect(const GBoxOriented& Box, const GVector3& Point);

		static bool		Intersect(const GBoxAligned& Box, const GBoxOriented& Box2);
		static bool		Intersect(const GBoxAligned& Box, const GBoxAligned& Box2);
	};

}

#endif